package com.yeyks.common.em.vip;

public enum  MemberCardEnableRecordStatusEnum {

    pay_pre(1,"待支付"),
    pay_success(2,"支付成功"),
    pay_fail(3,"支付失败"),
    pay_refund(4,"已退款");

    int value;
    String desc;

    MemberCardEnableRecordStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(int value) {
        MemberCardEnableRecordStatusEnum[] enumValues = values();
        for (MemberCardEnableRecordStatusEnum enumValue : enumValues) {
            if (enumValue.value() == value) {
                return enumValue.desc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        MemberCardEnableRecordStatusEnum[] enumValues = values();
        for (MemberCardEnableRecordStatusEnum enumValue : enumValues) {
            if (enumValue.desc().equals(desc)) {
                return enumValue.value();
            }
        }
        return null;
    }

    public static MemberCardEnableRecordStatusEnum getEnumFromDesc(String desc) {
        MemberCardEnableRecordStatusEnum[] enumValues = values();
        for (MemberCardEnableRecordStatusEnum enumValue : enumValues) {
            if (enumValue.desc().equals(desc)) {
                return enumValue;
            }
        }
        return null;
    }
    
}
